/**
 * Created by Administrator on 2017/8/3.
 */
var express = require('express');
var router = express.Router();
var thirdAuthController = require('../controllers/thirdAuth');
var passport = require('passport');
var promise = require('../util/promise');

//thirdAuth的github重定向
router.get('/github', passport.authenticate('github', {scope: ['user:email']}), promise(thirdAuthController.authGithub));
//thirdAuth的github回调
router.get('/github/callback', passport.authenticate('github', {failureRedirect: '/user/signin'}), promise(thirdAuthController.authGithubCb));

module.exports = router;